const KoaRouter = require('koa-router');

const authRouter = new KoaRouter({prefix: '/user'});

const { 
  verifyAuth
} = require('../middleware/auth.middleware');

const {
  verifyUser,
  handlePassworld
} = require('../middleware/user.middleware');

const {
  createUser,
  getUserAvatar,
  removeUser
} = require('../controller/user.controller');

// 用户注册
authRouter.post('/', verifyUser, handlePassworld, createUser);
// 获取用户头像
authRouter.get('/:userId/avatar', getUserAvatar);
// 删除用户
authRouter.delete('/remove', verifyAuth, removeUser);

module.exports = authRouter;